﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Pampa.Grid.Core.Actions;
using Pampa.MVC.Fluent.Common;

namespace Pampa.MVC.Fluent.Grid
{
    public class ActionItemBuilder<T> : ActionBuilder<T, ActionItemBuilder<T>>
    {
        private readonly ItemAction _action;

        public ActionItemBuilder(ItemAction action) : base(action)
        {
            _action = action;
        }

        public ActionItemBuilder<T> Image(string url)
        {
            _action.Image = url;
            return this;
        }

        public ActionItemBuilder<T> AddParameter(Expression<Func<T, object>> property)
        {
            _action.Parameters.Add(GetId(property));
            return this;
        }
    }
}
